Customizing Recorded SIP Messages Sent to SRS
The original SIP headers of recorded legs are not included in the INVITE messages that the device sends to the SRS. If you need to include SIP headers, you can use Message Manipulation rules (see Configuring SIP Message Manipulation) to add them to these INVITE messages. The following examples describe how to configure this using Message Manipulation rules:
■ | Example 1 - Adding a specific SIP header called "My-header" to the INVITE that is sent to the SRS: |
a. | The example uses two Message Manipulation rules - one for storing the header by using manipulation syntax for session variables, and one for adding the header to the INVITE. |
Parameter |
Value |
---|---|
Index |
0 |
Name |
Store My-header in var.session |
Manipulation Set ID |
11 |
Message Type |
Any |
Condition |
Header.My-header exists And Header.My-header != '' |
Action Subject |
Var.Session.0 |
Action Type |
Modify |
Action Value |
Header.My-header |
Index |
1 |
Name |
Send My-header to SRS |
Manipulation Set ID |
12 |
Message Type |
Invite.Request |
Condition |
Var.Session.0 != '' |
Action Subject |
Header.My-header |
Action Type |
Add |
Action Value |
Var.Session.0 |
b. | Assign the above manipulation rules to the relevant IP Groups: |
◆ | In the IP Group of the recorded call leg which sends this header, configure the 'Inbound Message Manipulation Set' parameter to 11 (i.e., rule configured in Index 0). |
◆ | In the IP Group of the SRS, configure the 'Outbound Message Manipulation Set' parameter to 12 (i.e., rule configured in Index 1). |
■ | Example 2 - Adding multiple (three) SIP headers called "My-header1", "My-header2" and "My-header3" to the INVITE that is sent to the SRS: |
a. | The example uses regex (regular expression) with manipulation rules for extracting each header (a comma is used to separate headers). |
Parameter |
Value |
---|---|
Index |
0 |
Name |
Store headers in var.session |
Manipulation Set ID |
11 |
Message Type |
Any |
Condition |
Header.My-header1 exists And Header.My-header2 exists And Header.My-header3 exists |
Action Subject |
Var.Session.0 |
Action Type |
Modify |
Action Value |
Header.My-header1+','+ Header.My-header2+','+ Header.My-header3 |
Row Rule |
Use Current Condition |
Index |
1 |
Name |
Send My-header1 to SRS |
Manipulation Set ID |
12 |
Message Type |
Invite.Request |
Condition |
Var.Session.0 regex (.*),(.*),(.*) |
Action Subject |
Header.My-header1 |
Action Type |
Add |
Action Value |
$1 |
Row Rule |
Use Current Condition |
Index |
2 |
Name |
Send My-header2 to SRS |
Manipulation Set ID |
12 |
Message Type |
Invite.Request |
Condition |
Var.Session.0 regex (.*),(.*),(.*) |
Action Subject |
Header.My-header2 |
Action Type |
Add |
Action Value |
$2 |
Row Rule |
Use Previous Condition |
Index |
3 |
Name |
Send My-header3 to SRS |
Manipulation Set ID |
12 |
Message Type |
Invite.Request |
Condition |
Var.Session.0 regex (.*),(.*),(.*) |
Action Subject |
Header.My-header3 |
Action Type |
Add |
Action Value |
$3 |
Row Rule |
Use Previous Condition |
b. | Assign the above manipulation rules to the relevant IP Groups: |
◆ | In the IP Group of the recorded call leg which sends this header, configure the 'Inbound Message Manipulation Set' parameter to 11 (i.e., rule configured in Index 0). |
◆ | In the IP Group of the SRS, configure the 'Outbound Message Manipulation Set' parameter to 12 (i.e., rules configured in Index 1, 2 and 3). |